ACTOR MageDagger : BrutalWeapon
{
	Obituary "%o was sacrificed by %k's arcane dagger."
    AttackSound "None"
    Inventory.PickupSound "AXEDRAW"
	Inventory.Pickupmessage "You got the mysterious dagger! (Slot1)"
    +WEAPON.NOAUTOAIM
    +WEAPON.NOAUTOFIRE
    +FORCEXYBILLBOARD
	damagetype Saw
	+WEAPON.NOALERT
	+WEAPON.AXEBLOOD
	Weapon.SelectionOrder 3000
	Scale 0.9
	Tag "Ritual Dagger"
	Inventory.ForbiddenTo BDoomer, Paladin, Corvus
	
	States
	{
	
	
		
	Ready3:
	Ready:
        MDAR A 0 A_JumpIfInventory("Kicking",1,"DoKick")
		MDAR A 0 A_Giveinventory("HasCutingWeapon",1)
        MDAR A 0 A_JumpIfInventory	("Taunting",1,"Taunt")
		MDAR A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		MDAR A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		MDAR A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		"####" A 0 A_JumpIfInventory("Quickspell",1,"Quickspell")
		MDAR A 1 A_WeaponReady
	Loop
	
	SpellFlash:
		TNT1 A 0
		MDQS AABBCCDDDDDDDDDDDDDDDCCBBAAA 1
	stop
	
	Deselect:
        MDAS HGFEDCBA 1
		AXEG A 0 A_Takeinventory("PowerBloodOnVisor",1)
		AXEG A 0 A_Takeinventory("PowerBlueBloodOnVisor",1)
		AXEG A 0 A_Takeinventory("PowerGreenBloodOnVisor",1)
		AXEG A 0 A_Takeinventory("HasCutingWeapon",1)
		TNT1 AAAAAAAAAAAAAAAAAA 0 A_Lower
		AXEG A 0 A_Takeinventory("HasCutingWeapon",1)
		AXEG A 0 A_TakeInventory("TossGrenade", 1)
		TNT1 A 1 A_Lower
		Wait
		
	Select:
		AXEG A 0 A_Giveinventory("GoSpecial",1)
		TNT1 A 1
		TNT1 A 1 A_Raise
		TNT1 AAAAAAAAAA 0 A_Raise
		Goto SelectAnimation
		
		
	SelectAnimation:
		TNT1 A 1
	    AXEG A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
        AXEG A 0 A_PlaySound("AXEDRAW")
        MDAS ABCDEFGH 1
       // AXEG A 0 A_GunFlash
		Goto Ready

	
    Fire:
		TNT1 A 0
		TNT1 A 0 A_TakeInventory("AxeHit", 1)
		TNT1 A 0 A_Recoil(-5)
		TNT1 A 0 A_PlaySound("Sorcerer/MediumExert", CHAN_VOICE) 		
		TNT1 A 0 A_FireCustomMissile("SwordLunge", 2, 0, 0, -4)	
        MDAL ABC 1
		//TNT1 A 0 A_FireCustomMissile("SwordLunge", 2, 0, 0, -4)	
		MDAL DEFGH 1
		TNT1 A 0 //A_Saw("", "", 3, "AxePuffs", 0, 120, 0,16)
        MDAL IJK 1 A_WeaponReady
		//TNT1 A 5 
		TNT1 A 2 A_Refire("SecondLunge")
				Goto Ready
	/* Hold:
		AXEG A 0
		AXEG A 0 A_TakeInventory("AxeHit", 1)
		AXEG E 1
		AXEG A 0 A_Refire
		AXEG D 1
		AXEF AB 1
	    AXEG A 0 A_PlaySound("weapons/gswing", 1)
		AXEG A 0 A_JumpIfInventory("PowerStrength", 1, "StrongAttack")
		AXEG A 0 A_Saw("", "", 3, "AxePuffs", 0, 120, 0,16)
		//AXEG A 0 A_FireCustomMissile("AxeAttack", 0, 0, 0, 0)  
		*/
		
	SecondLunge:
		TNT1 A 0
		TNT1 A 0 A_Recoil(-6)
		TNT1 A 0 A_TakeInventory("AxeHit", 1)
		TNT1 A 0 A_PlaySound("Sorcerer/LargeExert", CHAN_VOICE) 		
		TNT1 A 0 A_FireCustomMissile("SwordLunge", 2, 0, 0, -4)
        MD2L ABC 1
		//TNT1 A 0 A_FireCustomMissile("SwordLunge", 2, 0, 0, -4)	
		TNT1 A 0 //A_Saw("", "", 3, "AxePuffs", 0, 120, 0,16)
		//TNT1 A 0 A_FireCustomMissile("SwordLunge", 2, 0, 0, -4)
        MD2L DEFG 2 
		TNT1 A 1
	Goto Ready		
				
		
	Steady:
		TNT1 A 1
		Goto Ready	
	Spawn:
		AXE1 A 1
		AXE1 A -1
		Stop
		
			
		
	//Alt Fire Mode
	
	
	
    AltFire:
		TNT1 A 0
		TNT1 A 0 A_PlaySound("weapons/gswing", 1)
        MDSL ABCD 2
		TNT1 A 0 A_PlaySound("Sorcerer/MediumExert", CHAN_VOICE) 		
		MDSL C 1 A_FireCustomMissile("SwordSwing", 10, 0, 0, 0)
		MDSL E 1 //A_FireCustomMissile("SwordSwing", 0, 0, 0, 0)
		MDSL F 1 A_FireCustomMissile("SwordSwing", -10, 0, 0, 0)
		MDSL GH 1 
		TNT1 A 4 A_Refire("AltFire2")
		TNT1 A 4 A_JumpIfInventory("FiredPrimary",1,"AltFire3")
		Goto Ready

	AltFire2:
		TNT1 A 0
		TNT1 A 0 A_PlaySound("weapons/gswing", 1)
        MDS2 A 1
		TNT1 A 0 A_PlaySound("Sorcerer/MediumExert", CHAN_VOICE) 		
		MDS2 B 1 A_FireCustomMissile("SwordSwing", 10, 0, 0, 0)
		MDS2 C 1// A_FireCustomMissile("SwordSwing", 0, 0, 0, 0)
		MDS2 D 1 A_FireCustomMissile("SwordSwing", -10, 0, 0, 0)
		MDS2 E 2 
		TNT1 A 8 
		goto ready
		
	AltFire3:
		ASEG A 0
		MDSR ABCD 1 
	    ASEG A 0 A_PlaySound("weapons/gswing", 1)
		TNT1 A 0 A_PlaySound("Sorcerer/LargeExert", CHAN_VOICE) 		
//		ASEG A 0 A_Saw("", "", 3, "AxePuffs", -10, 120, 0,16)
		ASEG A 0 A_FireCustomMissile("SwordSwing", -10, 0, 0, 0)
		MDSR EF 1 
		ASEG A 0 A_FireCustomMissile("SwordSwing", 0, 0, 0, 0)
		MDSR GH 1 
		ASEG A 0 A_FireCustomMissile("SwordSwing", 10, 0, 0, 0)
		MDSR IJ 1 
		TNT1 A 12 
		Goto Ready
		
	AltEndSwing:	
		ASEF C 1 A_SetAngle(angle+2)
		ASEF D 1 A_SetAngle(angle+2)
		ASEF E 1 A_SetAngle(angle+4)
		TNT1 AA 1 A_SetAngle(angle+4)
		TNT1 A 5
		TNT1 AAAAAAAAA 1 A_SetAngle(angle-2)
		TNT1 A 1
		ASES A 1
		ASES BCD 1 A_WeaponReady(WRF_NOBOB)
		ASEG A 0 A_JumpIfInventory("PowerBloodOnVisor",1,"RedBloodReady")
        ASEG A 0 A_JumpIfInventory("powerBlueBloodOnVisor",1,"BlueBloodReady")
        ASEG A 0 A_JumpIfInventory("powerGreenBloodOnVisor",1,"GreenBloodReady")
		Goto Ready
		
			
	AltStrongAttack:
		ASEG A 0
		TNT1 A 0 A_PlaySound("Sorcerer/SpellCast", CHAN_VOICE) 		
		ASEG A 0 A_Saw("", "", 10, "AxePuffs", 0, 120, 0,16)
		ASEG AA 0 A_FireCustomMissile("AltAxeAttack", 0, 0, 0, 0)
		ASEG AA 0 A_FireCustomMissile("AltAxeAttack", 20, 0, 0, 0)
		ASEG AA 0 A_FireCustomMissile("AltAxeAttack", -20, 0, 0, 0)
		Goto AltEndSwing

	  
		
		
	}
}

